package com.hqyj.config;

import com.hqyj.handler.JwtHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 项目:demo-springboot-230701
 * 描述:
 * 时间:2023/9/28 11:10
 * 作者:admin
 * 版本:1.0
 **/
@Configuration
public class JwtHandlerConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //addPathPatterns 配置拦截规则
        //excludePathPatterns 配置不拦截
        registry.addInterceptor(new JwtHandler())
                .addPathPatterns("/user/user/**")
                .excludePathPatterns("/user/user/login");
    }
}
